<template>
	<view class="shop-item">
		<!-- 标题栏 -->
		<view class="shop-header">
			<text class="shop-name">{{ shop.name }}</text>
			<text class="shop-distance">{{ shop.distance }}m</text>
		</view>
		<!-- 评分栏 -->
		<view class="shop-rating">
			<!-- 星级（这里简化为文字，实际可替换为图标） -->
			<text class="star">★★★★</text>
			<text class="score">{{ shop.score }}分</text>
			<text class="sales">销量: {{ shop.sales }}</text>
		</view>
		<!-- 内容区 -->
		<view class="shop-content">
			<image :src="shop.image" class="shop-image" mode="widthFix"></image>
			<view class="shop-desc">
				<text class="shop-time">营业时间: {{ shop.time }}</text>
				<text class="shop-address">{{ shop.address }}</text>
			</view>
		</view>
		<!-- 分隔线 -->
		<view class="divider" v-if="showDivider"></view>
	</view>
</template>

<script>
	export default {
		props: {
			shop: {
				type: Object,
				default: () => ({})
			},
			showDivider: {
				type: Boolean,
				default: true
			}
		}
	};
</script>

<style scoped>
	.shop-item {
		padding: 20rpx;
	}

	.shop-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.shop-name {
		font-size: 32rpx;
		font-weight: bold;
	}

	.shop-distance {
		color: #5996FE;
		font-size: 20rpx;
		font-weight: 900;
	}

	.shop-rating {
		display: flex;
		align-items: center;
		margin-top: 10rpx;
	}

	.star {
		color: #ffc107;
	}

	.score,
	.sales {
		margin-top: 2rpx;
		margin-left: 26rpx;
		font-size: 12rpx;
		color: #3d3d3d;
		font-weight: 500;
	}

	.shop-content {
		display: flex;
		margin-top: 10rpx;
	}

	.shop-image {
		width: 240rpx;
		height: 200rpx;
		border-radius: 8rpx;
	}

	.shop-desc {
		margin-left: 20rpx;
		padding: 10rpx 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.shop-time,
	.shop-address {
		font-size: 20rpx;

		color: #666;
		line-height: 1.5;
	}

	.divider {
		height: 2rpx;
		background-color: #eee;
		margin: 20rpx 0;
	}
</style>